package com.smart.wap.bodys;

import com.smart.common.entities.domain.SmartPattern;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * @author Administrator
 */
public class WapMemberBody {


    @Data
    @Accessors(chain = true)
    @ApiModel("WapMemberBody1")
    public static class ChangeNameBody {

        @ApiModelProperty(value = "会员昵称", required = true)
        @NotBlank(message = "会员昵称 不能为空")
        @Length(min = 1, max = 8, message = "昵称长度不能超过8个字符")
        private String nickName;
    }


    @Data
    @Accessors(chain = true)
    @ApiModel("WapMemberBody2")
    public static class ChangeAvatarBody {
        @ApiModelProperty(value = "会员头像地址", required = true)
//        @NotBlank(message = "会员头像 不能为空")
//        @Pattern(regexp = RegexPool.URL_HTTP, message = "非法的头像格式文件")
        private String avatar;
    }


    @Data
    @ApiModel("WapMemberBody3")
    public static class SignOutBody implements Serializable {
        @ApiModelProperty(value = "手机号码", required = true)
        @NotBlank(message = "手机号码 不能为空")
        @Pattern(regexp = SmartPattern.PHONE, message = "手机号码 格式不正确")
        private String phoneNumber;

        @ApiModelProperty(value = "手机验证码", notes = "测试验证码:6个0", required = true)
        @NotBlank(message = "手机验证码 不能为空")
        @Length(min = 4, max = 6, message = "手机验证码 字符长度错误")
        private String captcha;
    }








    @Data
    @ApiModel("WapMemberBody4")
    public static class AddressBody implements Serializable {


        @ApiModelProperty("收货人姓名")
        @NotBlank(message = "收货人姓名 不能为空")
        @Length(max = 20,message = "收货人姓名 不能超过20个字符")
        private String name;


        @ApiModelProperty("收货人手机号")
        @NotBlank(message = "收货人手机号 不能为空")
        @Length(max = 11,message = "收货人手机号 不能超过20个字符")
        @Pattern(regexp = SmartPattern.PHONE ,message = "手机号码格式不正确")
        private String mobile;

        @ApiModelProperty("省份名称")
        @NotBlank(message = "省份名称 不能为空")
        @Length(max = 30,message = "收货人手机号 不能超过20个字符")
        private String province;

        @ApiModelProperty("城市名称")
        @NotBlank(message = "城市名称 不能为空")
        @Length(max = 30,message = "城市 不能超过20个字符")
        private String city;


        @ApiModelProperty("区县名称")
        @NotBlank(message = "区县名称 不能为空")
        @Length(max = 30,message = "区县名称 不能超过20个字符")
        private String district;


        @ApiModelProperty("默认你地址")
        private Boolean dfFlag;


        @ApiModelProperty("街道-小区-牌号")
        @NotBlank(message = "街道-小区-牌号 不能为空")
        private String address;
    }








}
